import { LoginResult } from "@/types/member";
import { httpRequest } from "@/utils/http";

type LoginParams = {
    code: string
    encryptedData: string
    iv: string
}

// 生产模式小程序登录接口
export const postLoginWxAPI = (data: LoginParams) => {
    return httpRequest<LoginResult>({
        method: 'POST',
        url: '/login/wxMin',
        data
    });
};

// 开发模式小程序登录接口
export const postLoginWxTestAPI = (phoneNumber = '15079172930') => {
    return httpRequest<LoginResult>({
        method: 'POST',
        url: '/login/wxMin/simple',
        data: { phoneNumber },
    });
};